
import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;

import java.io.IOException;

public class dateMapper extends Mapper<LongWritable, Text, date_FlowBean, Text> {
    date_FlowBean k = new date_FlowBean();
    Text v = new Text();
    @Override
    protected void map(LongWritable key, Text value, Context context) throws IOException, InterruptedException {
        String line = value.toString();
        String[] fields = line.split("\t");
        String jd_title = fields[1];
        long require_nums = Long.parseLong(fields[5]);
        long end_date = Long.parseLong(fields[9]);
        k.setEnd_date(end_date);
        k.setRequire_nums(require_nums);
        k.setjd_title(jd_title);
        v.set(jd_title);
        context.write(k,v);
    }
}